package cn.learn.athena.util;

/**
 * @author zlj
 * @Date 2018/11/1
 * @des 接口返回值
 */
public class Result<T> {

    private boolean success = true ;
    private String message = "操作成功";
    private Integer code = 200;
    private T data ;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public void setErr(String message) {
        this.success = false;
        this.code = 500 ;
        this.message = message ;
    }
}
